#include "ShapeTree.h"
ShapesTree::ShapesTree()
{
	data=NULL;
	left=NULL;
	right=NULL;
}

void ShapesTree::build(int deep)
{
	if (deep==0)
	{
		return;
	}	
	left=new ShapesTree;
	right=new ShapesTree;
	left->build(deep-1);
	right->build(deep-1);
}

void ShapesTree::destory()
{
	delete left;
	left=NULL;
	delete right;
	right=NULL;
}

void ShapesTree::insert( ShapesTree *root,Sphere *node )
{
	//if (node->center.x>0)
	//{
	//	if (node->center.y>0)
	//		add_sphere(root->right->right->data,node);
	//	else
	//		add_sphere(root->right->left->data,node);
	//}
	//else
	//{
	//	if (node->center.y>0)
	//		add_sphere(root->left->right->data,node);
	//	else
	//		add_sphere(root->left->left->data,node);
	//}
}

SphereClass * ShapesTree::intersect( Point o, Vector u, Point *hit, int n )
{
	return NULL;
}

ShapesTree::~ShapesTree( void )
{
	destory();
}
